import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Http} from '@angular/http';
import { Const } from '../../models/Const';


@IonicPage()
@Component({
  selector: 'page-form-list',
  templateUrl: 'form-list.html',
})
export class FormListPage {

  public pageSize:number=15;
  public page:number = 1;
  public dataList:Array<any>;

  constructor(
    public navCtrl: NavController, 
    public navParams: NavParams,
    public http:Http) {
  }

  ionViewDidLoad() {

    this.getPageData(this.page,this.pageSize);
  }

  getPageData(page,pagesize){
    var that = this;
    let url = Const.serverUrl+"/project/page?pageNum="+this.page+"&pageSize="+this.pageSize;
    this.http.post(url,{
      "title":"",
      "tableName":"",
      "tableSpaceName":"",
      "comment":"",
      "addtime":""
  }
  ).subscribe(
      function(data){
        if(data.json().msg=='success'){
          that.dataList = data.json().data.list;
         
        }else{
          alert('数据获取失败');
        }
      },
      error=>{

      }
    );
  }

}
